<%@ page language="java" import="java.util.*" pageEncoding="GB18030"%>
<%@page contentType="text/html; charset=UTF-8" import="java.util.*, user.*"%>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<%
	String username = null;
	if (session.getAttribute("uType") != null) 
	{
		if (session.getAttribute("uType").toString().equals("1"))
			username = session.getAttribute("username").toString(); 
	}
	
%>  

	

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Client Checkout</title>

<style type="text/css">
<!--
.STYLE1 {
	font-size: 16px;
	font-weight: bold;
	font-style: italic;
}
.STYLE2 {font-family: "Courier New", Courier, monospace}
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<script language = "javascript">
function confirm()
{
    document.form1.action="./DisplayInvoicePage.jsp"; 
	document.form1.submit(); 
}
</script>
</head>

<body>
<form id="form1" name="form1" action = "" >
    <p align="center">
    <label>
    <span class="STYLE4">
    <a href="index.jsp">
    <img src="Pics/restaurantLogo.JPG" alt="restaurantLogo" width="242" height="118" border="0" />
    </a>
    <br>
    <br>
    
    Receiver: <input type="text" name="clientCheckout_receiverName" <%= DisplayCheckoutPage.GetReceiverName(username) %> />
    <br>Cell No.:
    </span>
    <input type="text" name="clientCheckout_cell" <%= DisplayCheckoutPage.GetReceiverCell(username)%>/>      
  	</label>
  	</p>

    <p align="center">Street
    <input name="clientCheckout_streetField" type="text" size="70" maxlength="50" <%= DisplayCheckoutPage.GetReceiverAddress(username)%>/>
    </p>
    <p align="center">
    <label><span class="STYLE4"><br/>
    Checkout</span>
    <input type="submit" name="clientCheckout_confirm" value="Confirm" onclick = "confirm()" />
    <!--  <input type="submit" name="clientCheckout_cancel" value="Cancel"  onclick = "cancel()"/> -->
    </label>
  	</p>
	</form>
   
    <div align="center">
    <form action = "./checkout.jsp" method = "get" id = "form 2" name = 'form 2' />
    <p>
    <%
    	String CheckContain = request.getParameter("food_ID");
    	if ( CheckContain != null && CheckContain.length() > 0)
    	{
    		DBConnector db = DBConnector.getDBConnector();
    		String statement = "delete from contain where food_ID = " + CheckContain;
    		db.update(statement);
    	}
     %>
    <%= DisplayCheckoutPage.GetCheckoutInfo(username) %>
    </p>
    </form>
    
  </div>
</body>
</html>
